+Wed Jun 21 11:41:43 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtkimcontextsimple.c gtk/gtklabel.c
+ gtk/gtktexttypes.c gtk/testtext.c modules/linux-fb/basic.c:
+ Remove use of libunicode in favor of new GLib functions.
+
+ * gtk/gtkcolorsel.c: Remove conditional includes for FB, win32,
+ nano-x, framebuffer. The X11 include is just a hack until we get
+ the necessary functions in gdkcolor.h, so there is no reason to
+ add other includes of platforms.
+
+ * gtk/gtkwindow.c (gtk_window_compute_default_size): Revert
+ window bigger than the screen change.
+
+ * gtk/testgtk.c: Revert some random changes from Elliot
+ that had no particular point and were causing testgtkrc
+ not to function correctly.
+
+ * gdk/gdkregion-generic.h: Revert change from Elliot. Just
+ because GdkSegment and GdkRegionBox have the same fields,
+ it doesn't mean that 'typedef GdkSegment GdkRegionBox'
+ results in clearer code.
+
+ * gdk/x11/gdkinput-x11.c (gdk_input_common_select_events,
+ gdk_input_translate_coordinates): Fix missed GdkObjectification
+
2000-06-18 Elliot Lee <sopwith@redhat.com>
* gdk/Makefile.am, gdk/*/Makefile.am: Fix conditionality to work the "right" way.
+Wed Jun 21 11:41:43 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtkimcontextsimple.c gtk/gtklabel.c
+ gtk/gtktexttypes.c gtk/testtext.c modules/linux-fb/basic.c:
+ Remove use of libunicode in favor of new GLib functions.
+
+ * gtk/gtkcolorsel.c: Remove conditional includes for FB, win32,
+ nano-x, framebuffer. The X11 include is just a hack until we get
+ the necessary functions in gdkcolor.h, so there is no reason to
+ add other includes of platforms.
+
+ * gtk/gtkwindow.c (gtk_window_compute_default_size): Revert
+ window bigger than the screen change.
+
+ * gtk/testgtk.c: Revert some random changes from Elliot
+ that had no particular point and were causing testgtkrc
+ not to function correctly.
+
+ * gdk/gdkregion-generic.h: Revert change from Elliot. Just
+ because GdkSegment and GdkRegionBox have the same fields,
+ it doesn't mean that 'typedef GdkSegment GdkRegionBox'
+ results in clearer code.
+
+ * gdk/x11/gdkinput-x11.c (gdk_input_common_select_events,
+ gdk_input_translate_coordinates): Fix missed GdkObjectification
+
2000-06-18 Elliot Lee <sopwith@redhat.com>
* gdk/Makefile.am, gdk/*/Makefile.am: Fix conditionality to work the "right" way.
+Wed Jun 21 11:41:43 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtkimcontextsimple.c gtk/gtklabel.c
+ gtk/gtktexttypes.c gtk/testtext.c modules/linux-fb/basic.c:
+ Remove use of libunicode in favor of new GLib functions.
+
+ * gtk/gtkcolorsel.c: Remove conditional includes for FB, win32,
+ nano-x, framebuffer. The X11 include is just a hack until we get
+ the necessary functions in gdkcolor.h, so there is no reason to
+ add other includes of platforms.
+
+ * gtk/gtkwindow.c (gtk_window_compute_default_size): Revert
+ window bigger than the screen change.
+
+ * gtk/testgtk.c: Revert some random changes from Elliot
+ that had no particular point and were causing testgtkrc
+ not to function correctly.
+
+ * gdk/gdkregion-generic.h: Revert change from Elliot. Just
+ because GdkSegment and GdkRegionBox have the same fields,
+ it doesn't mean that 'typedef GdkSegment GdkRegionBox'
+ results in clearer code.
+
+ * gdk/x11/gdkinput-x11.c (gdk_input_common_select_events,
+ gdk_input_translate_coordinates): Fix missed GdkObjectification
+
2000-06-18 Elliot Lee <sopwith@redhat.com>
* gdk/Makefile.am, gdk/*/Makefile.am: Fix conditionality to work the "right" way.
+Wed Jun 21 11:41:43 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtkimcontextsimple.c gtk/gtklabel.c
+ gtk/gtktexttypes.c gtk/testtext.c modules/linux-fb/basic.c:
+ Remove use of libunicode in favor of new GLib functions.
+
+ * gtk/gtkcolorsel.c: Remove conditional includes for FB, win32,
+ nano-x, framebuffer. The X11 include is just a hack until we get
+ the necessary functions in gdkcolor.h, so there is no reason to
+ add other includes of platforms.
+
+ * gtk/gtkwindow.c (gtk_window_compute_default_size): Revert
+ window bigger than the screen change.
+
+ * gtk/testgtk.c: Revert some random changes from Elliot
+ that had no particular point and were causing testgtkrc
+ not to function correctly.
+
+ * gdk/gdkregion-generic.h: Revert change from Elliot. Just
+ because GdkSegment and GdkRegionBox have the same fields,
+ it doesn't mean that 'typedef GdkSegment GdkRegionBox'
+ results in clearer code.
+
+ * gdk/x11/gdkinput-x11.c (gdk_input_common_select_events,
+ gdk_input_translate_coordinates): Fix missed GdkObjectification
+
2000-06-18 Elliot Lee <sopwith@redhat.com>
* gdk/Makefile.am, gdk/*/Makefile.am: Fix conditionality to work the "right" way.
+Wed Jun 21 11:41:43 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtkimcontextsimple.c gtk/gtklabel.c
+ gtk/gtktexttypes.c gtk/testtext.c modules/linux-fb/basic.c:
+ Remove use of libunicode in favor of new GLib functions.
+
+ * gtk/gtkcolorsel.c: Remove conditional includes for FB, win32,
+ nano-x, framebuffer. The X11 include is just a hack until we get
+ the necessary functions in gdkcolor.h, so there is no reason to
+ add other includes of platforms.
+
+ * gtk/gtkwindow.c (gtk_window_compute_default_size): Revert
+ window bigger than the screen change.
+
+ * gtk/testgtk.c: Revert some random changes from Elliot
+ that had no particular point and were causing testgtkrc
+ not to function correctly.
+
+ * gdk/gdkregion-generic.h: Revert change from Elliot. Just
+ because GdkSegment and GdkRegionBox have the same fields,
+ it doesn't mean that 'typedef GdkSegment GdkRegionBox'
+ results in clearer code.
+
+ * gdk/x11/gdkinput-x11.c (gdk_input_common_select_events,
+ gdk_input_translate_coordinates): Fix missed GdkObjectification
+
2000-06-18 Elliot Lee <sopwith@redhat.com>
* gdk/Makefile.am, gdk/*/Makefile.am: Fix conditionality to work the "right" way.
+Wed Jun 21 11:41:43 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtkimcontextsimple.c gtk/gtklabel.c
+ gtk/gtktexttypes.c gtk/testtext.c modules/linux-fb/basic.c:
+ Remove use of libunicode in favor of new GLib functions.
+
+ * gtk/gtkcolorsel.c: Remove conditional includes for FB, win32,
+ nano-x, framebuffer. The X11 include is just a hack until we get
+ the necessary functions in gdkcolor.h, so there is no reason to
+ add other includes of platforms.
+
+ * gtk/gtkwindow.c (gtk_window_compute_default_size): Revert
+ window bigger than the screen change.
+
+ * gtk/testgtk.c: Revert some random changes from Elliot
+ that had no particular point and were causing testgtkrc
+ not to function correctly.
+
+ * gdk/gdkregion-generic.h: Revert change from Elliot. Just
+ because GdkSegment and GdkRegionBox have the same fields,
+ it doesn't mean that 'typedef GdkSegment GdkRegionBox'
+ results in clearer code.
+
+ * gdk/x11/gdkinput-x11.c (gdk_input_common_select_events,
+ gdk_input_translate_coordinates): Fix missed GdkObjectification
+
2000-06-18 Elliot Lee <sopwith@redhat.com>
* gdk/Makefile.am, gdk/*/Makefile.am: Fix conditionality to work the "right" way.
+Wed Jun 21 11:41:43 2000 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkentry.c gtk/gtkimcontextsimple.c gtk/gtklabel.c
+ gtk/gtktexttypes.c gtk/testtext.c modules/linux-fb/basic.c:
+ Remove use of libunicode in favor of new GLib functions.
+
+ * gtk/gtkcolorsel.c: Remove conditional includes for FB, win32,
+ nano-x, framebuffer. The X11 include is just a hack until we get
+ the necessary functions in gdkcolor.h, so there is no reason to
+ add other includes of platforms.
+
+ * gtk/gtkwindow.c (gtk_window_compute_default_size): Revert
+ window bigger than the screen change.
+
+ * gtk/testgtk.c: Revert some random changes from Elliot
+ that had no particular point and were causing testgtkrc
+ not to function correctly.
+
+ * gdk/gdkregion-generic.h: Revert change from Elliot. Just
+ because GdkSegment and GdkRegionBox have the same fields,
+ it doesn't mean that 'typedef GdkSegment GdkRegionBox'
+ results in clearer code.
+
+ * gdk/x11/gdkinput-x11.c (gdk_input_common_select_events,
+ gdk_input_translate_coordinates): Fix missed GdkObjectification
+
2000-06-18 Elliot Lee <sopwith@redhat.com>
* gdk/Makefile.am, gdk/*/Makefile.am: Fix conditionality to work the "right" way.
#ifndef __GDK_REGION_GENERIC_H__
#define __GDK_REGION_GENERIC_H__
-#include "gdktypes.h"
+typedef struct _GdkRegionBox GdkRegionBox;
-typedef GdkSegment GdkRegionBox;
+struct _GdkRegionBox
+{
+ int x1, x2, y1, y2;
+};
/*
* clip region
gdk_input_common_find_events(window, gdkdev, 0, classes, &num_classes);
else
gdk_input_common_find_events(window, gdkdev,
- ((GdkWindowPrivate *)window)->extension_events,
+ ((GdkWindowObject *)window)->extension_events,
classes, &num_classes);
XSelectExtensionEvent (gdk_display,
gdouble *x, gdouble *y, gdouble *pressure,
gdouble *xtilt, gdouble *ytilt)
{
- GdkDrawablePrivate *drawable_priv;
+ GdkWindowImplX11 *impl;
int x_axis, y_axis, pressure_axis, xtilt_axis, ytilt_axis;
double device_width, device_height;
double x_offset, y_offset, x_scale, y_scale;
- drawable_priv = (GdkDrawablePrivate *) input_window->window;
+ impl = GDK_WINDOW_IMPL_X11 (((GdkWindowObject *) input_window->window)->impl);
x_axis = gdkdev->axis_for_use[GDK_AXIS_X];
y_axis = gdkdev->axis_for_use[GDK_AXIS_Y];
double device_aspect = (device_height*gdkdev->axes[y_axis].resolution) /
(device_width*gdkdev->axes[x_axis].resolution);
- if (device_aspect * drawable_priv->width >= drawable_priv->height)
+ if (device_aspect * impl->width >= impl->height)
{
/* device taller than window */
- x_scale = drawable_priv->width / device_width;
+ x_scale = impl->width / device_width;
y_scale = (x_scale * gdkdev->axes[x_axis].resolution)
/ gdkdev->axes[y_axis].resolution;
x_offset = 0;
y_offset = -(device_height * y_scale -
- drawable_priv->height)/2;
+ impl->height)/2;
}
else
{
/* window taller than device */
- y_scale = drawable_priv->height / device_height;
+ y_scale = impl->height / device_height;
x_scale = (y_scale * gdkdev->axes[y_axis].resolution)
/ gdkdev->axes[x_axis].resolution;
y_offset = 0;
- x_offset = - (device_width * x_scale - drawable_priv->width)/2;
+ x_offset = - (device_width * x_scale - impl->width)/2;
}
}
#if defined (GDK_WINDOWING_X11)
#include "x11/gdkx.h"
-#elif defined (GDK_WINDOWING_WIN32)
-#include "win32/gdkwin32.h"
-#elif defined (GDK_WINDOWING_NANOX)
-#include "nanox/gdkprivate-nanox.h"
-#elif defined (GDK_WINDOWING_FB)
-#include "linux-fb/gdkprivate-fb.h"
#endif
#include "gdk/gdkkeysyms.h"
#include "gtkcolorsel.h"
#include "gtkstyle.h"
#include <pango/pango.h>
-#include <unicode.h>
#include <glib-object.h>
#define MIN_ENTRY_WIDTH 150
{
GtkWidget *widget = GTK_WIDGET (entry);
- PangoAttrList *attrs;
-
if (!entry->layout)
{
entry->layout = gtk_widget_create_pango_layout (widget);
{
gint *ranges;
gint n_ranges, i;
- gint start_index = unicode_offset_to_index (entry->text,
- MIN (editable->selection_start_pos, editable->selection_end_pos));
- gint end_index = unicode_offset_to_index (entry->text,
- MAX (editable->selection_start_pos, editable->selection_end_pos));
+ gint start_index = g_utf8_offset_to_pointer (entry->text,
+ MIN (editable->selection_start_pos, editable->selection_end_pos)) - entry->text;
+ gint end_index = g_utf8_offset_to_pointer (entry->text,
+ MAX (editable->selection_start_pos, editable->selection_end_pos)) - entry->text;
GtkStateType selected_state = editable->has_selection ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE;
GdkRegion *clip_region = gdk_region_new ();
pango_layout_line_x_to_index (line, x * PANGO_SCALE, &index, &trailing);
if (trailing)
- index = unicode_next_utf8 (entry->text + index) - entry->text;
+ index = g_utf8_next_char (entry->text + index) - entry->text;
return index;
}
gtk_entry_ensure_layout (entry);
- index = unicode_offset_to_index (entry->text, editable->current_pos);
+ index = g_utf8_offset_to_pointer (entry->text, editable->current_pos) - entry->text;
pango_layout_get_cursor_pos (entry->layout, index, &strong_pos, &weak_pos);
if (strong_x)
if (new_text_length < 0)
new_text_length = strlen (new_text);
- n_chars = unicode_strlen (new_text, new_text_length);
+ n_chars = g_utf8_strlen (new_text, new_text_length);
if (entry->text_max_length > 0 && n_chars + entry->text_length > entry->text_max_length)
{
gdk_beep ();
entry->text = g_realloc (entry->text, entry->text_size);
}
- index = unicode_offset_to_index (entry->text, *position);
+ index = g_utf8_offset_to_pointer (entry->text, *position) - entry->text;
g_memmove (entry->text + index + new_text_length, entry->text + index, entry->n_bytes - index);
memcpy (entry->text + index, new_text, new_text_length);
(start_pos >= 0) &&
(end_pos <= entry->text_length))
{
- gint start_index = unicode_offset_to_index (entry->text, start_pos);
- gint end_index = unicode_offset_to_index (entry->text, end_pos);
+ gint start_index = g_utf8_offset_to_pointer (entry->text, start_pos) - entry->text;
+ gint end_index = g_utf8_offset_to_pointer (entry->text, end_pos) - entry->text;
g_memmove (entry->text + start_index, entry->text + end_index, entry->n_bytes - end_index);
entry->text_length -= (end_pos - start_pos);
start_pos = MIN (entry->text_length, start_pos);
end_pos = MIN (entry->text_length, end_pos);
- start_index = unicode_offset_to_index (entry->text, start_pos);
- end_index = unicode_offset_to_index (entry->text, end_pos);
+ start_index = g_utf8_offset_to_pointer (entry->text, start_pos) - entry->text;
+ end_index = g_utf8_offset_to_pointer (entry->text, end_pos) - entry->text;
return g_strndup (entry->text + start_index, end_index - start_index);
}
entry = GTK_ENTRY (editable);
- index = unicode_offset_to_index (entry->text, editable->current_pos);
+ index = g_utf8_offset_to_pointer (entry->text, editable->current_pos) - entry->text;
/* Horizontal motion */
entry = GTK_ENTRY (editable);
- index = unicode_offset_to_index (entry->text, editable->current_pos);
+ index = g_utf8_offset_to_pointer (entry->text, editable->current_pos) - entry->text;
gtk_entry_ensure_layout (entry);
break;
if (new_trailing)
- index = unicode_next_utf8 (entry->text + new_index) - entry->text;
+ index = g_utf8_next_char (entry->text + new_index) - entry->text;
else
index = new_index;
}
- editable->current_pos = unicode_index_to_offset (entry->text, index);
+ editable->current_pos = g_utf8_pointer_to_offset (entry->text, entry->text + index);
}
static void
* Boston, MA 02111-1307, USA.
*/
-#include <unicode.h>
#include <gdk/gdkkeysyms.h>
#include "gtksignal.h"
#include "gtkimcontextsimple.h"
return GTK_IM_CONTEXT (gtk_type_new (GTK_TYPE_IM_CONTEXT_SIMPLE));
}
-/**
- * unicode_guchar4_to_utf8:
- * @ch: a ISO10646 character code
- * @out: output buffer, must have at least 6 bytes of space.
- *
- * Convert a single character to utf8
- *
- * Return value: number of bytes written
- **/
-static int
-ucs4_to_utf8 (unicode_char_t c, char *outbuf)
-{
- size_t len = 0;
- int first;
- int i;
-
- if (c < 0x80)
- {
- first = 0;
- len = 1;
- }
- else if (c < 0x800)
- {
- first = 0xc0;
- len = 2;
- }
- else if (c < 0x10000)
- {
- first = 0xe0;
- len = 3;
- }
- else if (c < 0x200000)
- {
- first = 0xf0;
- len = 4;
- }
- else if (c < 0x4000000)
- {
- first = 0xf8;
- len = 5;
- }
- else
- {
- first = 0xfc;
- len = 6;
- }
-
- for (i = len - 1; i > 0; --i)
- {
- outbuf[i] = (c & 0x3f) | 0x80;
- c >>= 6;
- }
- outbuf[0] = c | first;
-
- return len;
-}
-
static void
gtk_im_context_simple_commit_char (GtkIMContext *context,
- unicode_char_t ch)
+ gunichar ch)
{
- gchar buf[7];
+ gchar buf[10];
gint len;
- len = ucs4_to_utf8 (ch, buf);
+ len = g_unichar_to_utf8 (ch, buf);
buf[len] = '\0';
gtk_signal_emit_by_name (GTK_OBJECT (context), "commit", &buf);
GtkIMContextSimple *context_simple = GTK_IM_CONTEXT_SIMPLE (context);
GtkComposeSeq *seq;
- unicode_char_t ch;
+ gunichar ch;
int n_compose = 0;
int i;
#include "gdk/gdkkeysyms.h"
#include "gdk/gdki18n.h"
#include <pango/pango.h>
-#include <unicode.h>
enum {
{
while (*p && *q && *q != '_')
{
- p = unicode_next_utf8 (p);
+ p = g_utf8_next_char (p);
q++;
}
start = p;
while (*p && *q && *q == '_')
{
- p = unicode_next_utf8 (p);
+ p = g_utf8_next_char (p);
q++;
}
/* Convert text to wide characters */
new_str = g_new (gchar, strlen (str) + 1);
- pattern = g_new (gchar, unicode_strlen (str, -1) + 1);
+ pattern = g_new (gchar, g_utf8_strlen (str, -1) + 1);
underscore = FALSE;
while (*src)
{
- unicode_char_t c;
+ gunichar c;
gchar *next_src;
-
- next_src = unicode_get_utf8 (src, &c);
- if (!next_src)
+
+ c = g_utf8_get_char (src);
+ if (c == (gunichar)-1)
{
g_warning ("Invalid input string");
g_free (new_str);
g_free (pattern);
return GDK_VoidSymbol;
}
+ next_src = g_utf8_next_char (src);
if (underscore)
{
* API, eventually should just use libunicode/Pango directly)
*/
-#include <unicode.h>
-
#if 0
static void
trigger_efence(const gchar *str, gint len)
gtk_text_view_num_utf_chars(const gchar *str, gint len)
{
trigger_efence(str, len);
- return unicode_strlen(str, len);
+ return g_utf8_strlen(str, len);
}
/* FIXME we need a version of this function with error handling, so we
gint
gtk_text_utf_to_unichar(const gchar *str, GtkTextUniChar *chPtr)
{
- unicode_char_t ch;
- gchar *end;
+ gunichar ch;
- end = unicode_get_utf8(str, &ch);
+ ch = g_utf8_get_char (str);
- if (end == NULL)
+ if (ch == (gunichar)-1)
g_error("Bad UTF8, need to add some error checking so this doesn't crash the program");
*chPtr = ch;
trigger_efence(str, end - str);
- return end - str;
+ return g_utf8_next_char (str) - str;
}
gchar*
trigger_efence(start, str - start);
- retval = unicode_previous_utf8(start, str);
+ retval = g_utf8_find_prev_char (start, str);
return retval;
}
#include "x11/gdkx.h"
#elif defined (GDK_WINDOWING_WIN32)
#include "win32/gdkwin32.h"
-#elif defined (GDK_WINDOWING_FB)
-#include "linux-fb/gdkfb.h"
#elif defined (GDK_WINDOWING_NANOX)
#include "nanox/gdkprivate-nanox.h"
#endif
*width = info->width > 0 ? info->width : *width;
*height = info->height > 0 ? info->height : *height;
}
-
- *width = MIN(*width, gdk_screen_width());
- *height = MIN(*width, gdk_screen_height());
}
/* Constrain a window size to obey the hints passed in geometry
gtk_main_quit ();
}
-GtkWidget *
+void
create_main_window (void)
{
struct {
for (i = 0; i < nbuttons; i++)
{
button = gtk_button_new_with_label (buttons[i].label);
- gtk_widget_set_name(button, buttons[i].label);
if (buttons[i].func)
gtk_signal_connect (GTK_OBJECT (button),
"clicked",
gtk_widget_grab_default (button);
gtk_widget_show_all (window);
-
- return window;
}
int
"debug_msg",
1,
GTK_TYPE_STRING, "GtkWidgetClass <ctrl><release>9 test");
+
create_main_window ();
+
gtk_main ();
return 0;
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <unicode.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
{
gint count;
char *leftover, *next;
- unicode_char_t wc;
int to_read = 2047 - remaining;
count = fread (buf + remaining, 1, to_read, f);
if (!*leftover)
break;
- next = unicode_get_utf8 (next, &wc);
+ next = g_utf8_next_char (next);
}
gtk_text_buffer_insert (buffer, &iter, buf, leftover - buf);
#include <glib.h>
#include <pango/pango.h>
#include "gdkprivate-fb.h"
-#include <unicode.h>
#include <fribidi/fribidi.h>
PangoGlyph
Charset *charset,
const char *input);
-/* From pango/utils.h */
-typedef guint16 GUChar2;
-typedef guint32 GUChar4;
-
-gboolean _pango_utf8_iterate (const char *cur,
- const char **next,
- GUChar4 *wc_out);
-GUChar2 *_pango_utf8_to_ucs2 (const char *str,
- gint len);
-GUChar4 *_pango_utf8_to_ucs4 (const char *str,
- int len);
-int _pango_guchar4_to_utf8 (GUChar4 c,
- char *outbuf);
-int _pango_utf8_len (const char *str,
- gint limit);
-
#include "tables-big.i"
static PangoEngineInfo script_engines[] = {
}
PangoGlyph
-find_char (CharCache *cache, PangoFont *font, GUChar4 wc, const char *input)
+find_char (CharCache *cache, PangoFont *font, gunichar wc, const char *input)
{
return FT_Get_Char_Index(PANGO_FB_FONT(font)->ftf, wc);
}
{
iconv_t cd;
char outbuf;
- const char *p;
const char *inptr = input;
size_t inbytesleft;
char *outptr = &outbuf;
size_t outbytesleft = 1;
- _pango_utf8_iterate (input, &p, NULL);
- inbytesleft = p - input;
+ inbytesleft = g_utf8_next_char (input) - input;
cd = find_converter (cache, charset);
{
iconv_t cd;
char outbuf[2];
- const char *p;
const char *inptr = input;
size_t inbytesleft;
char *outptr = outbuf;
size_t outbytesleft = 2;
- _pango_utf8_iterate (input, &p, NULL);
- inbytesleft = p - input;
+ inbytesleft = g_utf8_next_char (input) - input;
cd = find_converter (cache, charset);
Charset *charset,
const char *input)
{
- GUChar4 wc;
-
- unicode_get_utf8 (input, &wc);
- return wc;
+ return g_utf8_get_char (input);
}
static void
int n_chars;
int i;
const char *p;
- const char *next;
CharCache *cache;
cache = get_char_cache (font);
- n_chars = unicode_strlen (text, length);
+ n_chars = g_utf8_strlen (text, length);
pango_glyph_string_set_size (glyphs, n_chars);
p = text;
for (i=0; i < n_chars; i++)
{
- GUChar4 wc;
+ gunichar wc;
FriBidiChar mirrored_ch;
PangoGlyph index;
char buf[6];
const char *input;
- _pango_utf8_iterate (p, &next, &wc);
+ wc = g_utf8_get_char (p);
input = p;
if (analysis->level % 2)
{
wc = mirrored_ch;
- _pango_guchar4_to_utf8 (wc, buf);
+ g_unichar_to_utf8 (wc, buf);
input = buf;
}
{
set_glyph (font, glyphs, i, p - text, index);
- if (unicode_type (wc) == UNICODE_NON_SPACING_MARK)
+ if (g_unichar_type (wc) == G_UNICODE_NON_SPACING_MARK)
{
if (i > 0)
{
set_glyph (font, glyphs, i, p - text, pango_fb_get_unknown_glyph (font));
}
- p = next;
+ p = g_utf8_next_char (p);
}
/* Simple bidi support... may have separate modules later */
{
CharCache *cache = get_char_cache (font);
PangoCoverage *result = pango_coverage_new ();
- GUChar4 wc;
+ gunichar wc;
for (wc = 0; wc < 65536; wc++)
{
char buf[6];
- _pango_guchar4_to_utf8 (wc, buf);
+ g_unichar_to_utf8 (wc, buf);
if (find_char (cache, font, wc, buf))
pango_coverage_set (result, wc, PANGO_COVERAGE_EXACT);
}
gtk_main_quit ();
}
-GtkWidget *
+void
create_main_window (void)
{
struct {
for (i = 0; i < nbuttons; i++)
{
button = gtk_button_new_with_label (buttons[i].label);
- gtk_widget_set_name(button, buttons[i].label);
if (buttons[i].func)
gtk_signal_connect (GTK_OBJECT (button),
"clicked",
gtk_widget_grab_default (button);
gtk_widget_show_all (window);
-
- return window;
}
int
"debug_msg",
1,
GTK_TYPE_STRING, "GtkWidgetClass <ctrl><release>9 test");
+
create_main_window ();
+
gtk_main ();
return 0;
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <unicode.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
{
gint count;
char *leftover, *next;
- unicode_char_t wc;
int to_read = 2047 - remaining;
count = fread (buf + remaining, 1, to_read, f);
if (!*leftover)
break;
- next = unicode_get_utf8 (next, &wc);
+ next = g_utf8_next_char (next);
}
gtk_text_buffer_insert (buffer, &iter, buf, leftover - buf);